package com.haredot.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;

/**
 * 
 * @TableName tb_comments
 */

@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@TableName(value ="tb_comments")
public class Comments implements Serializable {
    @Serial
    private static final long serialVersionUID = 1928680204816483203L;
    /**
     * 
     */
    @TableId(type = IdType.ASSIGN_ID)
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    /**
     * 评论星
     */
    private Integer star;

    /**
     * 评论内容
     */
    private String content;

    /**
     * 评论人
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long userId;

    /**
     * 资源ID
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long resId;

    /**
     * 评论信息状态、0 待审核 1 已审核 -1 未通过审核
     */
    private Integer state;

    /**
     * 审核人员
     */
    private String user;

    /**
     * 审核失败原因
     */
    private String reason;

    /**
     * 评论时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private Date createTime;


}